<template>
	<view>
		<!-- 1，img -->
		<view class="top-img">
			<image :src="topImg"></image>
		</view>
		<!-- 2，注释 -->
		<view class="box">
			<text>账号注销后将视为放弃以下权利：</text>
		</view>
		<view class="box">
			<text>1 、账户信息、身份信息、联系人信息、将全部被清空并且无法恢复</text>
		</view>
		<view class="box">
			<text>2、所有交易明细记录将被清空且无法恢复请确保所有交易已完结且无纠纷账号注销后历史交易可能产生资金退回权益等将视作自动放弃：</text>
		</view>
		<view class="box">
			<text>3、注销后，账户中的余额都将作废无法恢复</text>
		</view>
		<view class="box">
			<text>4、被注销账号的登入账号将不可再重新登入，要过7天后才可重新注册</text>
		</view>
		<my-bottom-btn :title="btnTitle" @clickBtn="clickBtn"></my-bottom-btn>
	</view>
</template>

<script>
	import myBottomBtn from '@/components/common/my-bottom-btn/my-bottom-btn.vue'

	import {
		logOff
	} from '@/api/http/login/login.js'

	export default {
		components: {
			myBottomBtn
		},
		data() {
			return {
				topImg: require('@/static/img/main/my/commonly/11.svg'),
				btnTitle: '注销'
			}
		},
		methods: {
			async clickBtn() {
				var that = this
				uni.$isShowModal('是否注销账号？').then(resultState => {
					if (resultState) {
						logOff().then(res => {
							if (res.data.pubInfo.code !== 0) {
								return uni.$showMsg(res.data.pubInfo.message);
							}
							uni.$showMsg('注销成功！')

							//删除本地缓存
							uni.clearStorageSync()
							//删除vuex的缓存
							//this.cleanStateFun()

							uni.reLaunch({
								url: "/pages/login/login/login",
								success: () => {
									//plus.navigator.closeSplashscreen();
								}
							})
						})
					}
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.top-img {
		width: 100%;
		text-align: center;
		padding: 30rpx 0;

		image {
			width: 160rpx;
			height: 160rpx;
		}
	}

	.box {
		width: 90%;
		margin-left: 5%;
		margin-top: 20rpx;
		font-size: 28rpx;
	}
</style>